<?php
function urlresult_fn($job)
{
  echo "Received job: " . $job->handle() . "\n";
  $workload = $job->workload();
  $args = unserialize($workload);
  $url = $args["url"];
  $reg = $args["reg"];
  $encode = $args["encode"];
  $c= file_get_contents($url,0,null,0,10240000);
  $c=iconv($encode,"UTF-8",$c);
  preg_match_all($reg,$c,$matches);
  return serialize($matches);
  //return  $c;
}
